/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * All Rights Researved.
 *
 * This library is developed and distributed for free usage,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * You can redistribute and/or modify it under the terms of the
 * Simplified BSD License
 *
 *
 *
 *
 *
 *
 *
 * For reading Meta file in csv format and  contain only String type. e.g.
 * @author: jin Chen 
 * @date: Oct 21, 2003$
 * @version: 1.0
 */
package edu.psu.geovista.app.pcp.toolkits.file;

import edu.psu.geovista.data.geog.DataSetForApps;
import edu.psu.geovista.data.model.AppDataModel;
import edu.psu.geovista.io.csv.GeogCSVReaderForAllString;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class CSVMetaFileReader {
    public static final boolean DEBUG = false;
    private Object[] rawData;
    private DataSetForApps dataSetApps;
    private AppDataModel dataModel;
    public void read(String fileName) throws FileNotFoundException {
        GeogCSVReaderForAllString csv = new GeogCSVReaderForAllString();
        FileInputStream inStream = null;
        try {
            inStream = new FileInputStream(fileName);
            rawData = csv.readFile(inStream);


        } catch (FileNotFoundException e) {

            if (DEBUG) {
                e.printStackTrace();  //To change body of catch statement use Options | File Templates.
            }
            throw e;
        }

    }
    public DataSetForApps getAsDataSetForApps(){
        DataSetForApps data=new DataSetForApps();
        data.setDataObject(rawData);
        return data;

    }

    public Object[] getRawData() {
        return rawData;
    }
    /*public  AppDataModel getDataAsAppDataModel(){
        return  null;
    }*/
}
